package it.unical.mat.aec.gui;

import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.ImageIcon;

public class IconImage {

	   private ImageIcon icon;
	   
	public IconImage(String imageIconName, Dimension dim) {
		Toolkit tk=Toolkit.getDefaultToolkit();
		Image im=tk.getImage(imageIconName);
		im=im.getScaledInstance(dim.width-5, dim.height-5,Image.SCALE_SMOOTH);
		icon=new ImageIcon(im);
	}

	public ImageIcon getIcon() {
		return icon;
	}

}
